package com.woniu.day8.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.day8.pojo.Owner;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface OwnerMapper extends BaseMapper<Owner> {
    @Select("SELECT * FROM t_owner o WHERE o.id= #{oid}")
    @Results(value = {
            @Result(id = true, column = "id", property = "id"),
            @Result(property = "username", column = "username"),
            @Result(property = "tel", column = "tel"),
            @Result(property = "sex", column = "sex"),
            @Result(property = "houseId", column = "house_id"),
            @Result(property = "password", column = "password"),
            @Result(property = "isdelete", column = "isDelete"),
            @Result(property = "identity", column = "identity"),
            @Result(property = "remarks", column = "remarks"),
            @Result(property = "deltime", column = "deltime"),
            @Result(property = "carcharges", column = "id",
                    many = @Many(select = "com.woniu.day8.mapper.CarchargeMapper.selectCarchargeById"))
    })
    List<Owner> selectOwnerById(Integer oid);
}
